package web.vaadin.menu;

import java.io.Serializable;
import java.util.List;

import com.vaadin.data.Container;
import com.vaadin.data.util.BeanItemContainer;

@SuppressWarnings("serial")
public class MenuContainer extends BeanItemContainer<Menu> implements
		Serializable {
	private MenuContainer c; 
	private static Menu soup[];
	private static Menu garnish[];

	private FakeDB db = new FakeDB();

	public static final Object DISH_NAME = "Dish name";

	public MenuContainer() throws IllegalArgumentException {
		super(Menu.class);
		
		// TODO Auto-generated constructor stub

	}

	public MenuContainer getSoups() {
		c = new MenuContainer();
		soup = db.getSoups(); // get data from DB
		c.removeAllItems();
		for (int i = 0; i < soup.length; i++) {
			c.addItem(soup[i]);
		}
		return c;

		// return (fillContainer(soup));
	}

	public MenuContainer getGarnish() {
//		garnish = db.getGarnish(); // get data from DB
//		
//		c.removeAllItems();
//		for (int i = 0; i < garnish.length; i++) {
//			c.addItem(garnish[i]);
//		}
		return (new MenuContainer());
		// return (fillContainer(garnish));
		

	}

	public static MenuContainer getBird() {
		// TODO Auto-generated method stub
		return null;
	}

	public static MenuContainer getFish() {
		// TODO Auto-generated method stub
		return null;
	}

	// private MenuContainer fillContainer(Menu[] m){
	// c.removeAllItems();
	// for (int i = 0; i < m.length; i++) {
	// c.addItem(m[i]);
	// }
	// return c;
}
